﻿<Window x:Class="Probel.Ldoc.Shell.Views.SettingsView"
        
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:t="clr-namespace:Probel.Ldoc.Shell.Properties"
        xmlns:conv="clr-namespace:Probel.Ldoc.Views.Converters;assembly=Probel.Ldoc.Views"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        
        Title="{x:Static t:Messages.Title_Settings}" 
        Height="400" 
        Width="600" 
        ShowInTaskbar="False" 
        WindowStyle="ToolWindow" 
        ResizeMode="NoResize"
        
        Loaded="Window_Loaded" WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <conv:InvertBoolConverter x:Key="InvertBool"/>
        <Style TargetType="CheckBox">
            <Setter Property="Margin" Value="5"/>
        </Style>
        <Style TargetType="GroupBox">
            <Setter Property="Margin" Value="5"/>
        </Style>
        <Style TargetType="RadioButton">
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <DockPanel>
        <Border Style="{StaticResource ToolBoxBorderStyle}">
            <StackPanel DockPanel.Dock="Bottom"
                    Orientation="Horizontal" 
                    HorizontalAlignment="Right">
                <Button Content="{x:Static t:Messages.Btn_Ok}" 
                    Style="{StaticResource ButtonToolBoxStyle}"
                                      Click="Click_Ok"/>
                <Button Content="{x:Static t:Messages.Btn_Cancel}" 
                    Style="{StaticResource ButtonToolBoxStyle}"
                                      Click="Click_Cancel"/>
            </StackPanel>
        </Border>
        <TabControl DockPanel.Dock="Top">
            <TabItem Header="{x:Static t:Messages.Tab_General}">
                <DockPanel LastChildFill="True">
                    <GroupBox DockPanel.Dock="Top" 
                              Header="{x:Static t:Messages.Gb_MenuManagement}">
                        <StackPanel>
                            <CheckBox x:Name="cb_MenuTextVisibility" 
                                      IsEnabled="{Binding ElementName=cb_RibbonVisible, Path=IsChecked, Converter={StaticResource InvertBool}}"
                                      Content="{x:Static t:Messages.Cb_MenuTextVisibility}"/>
                            <CheckBox x:Name="cb_RibbonVisible"
                                      Content="{x:Static t:Messages.Cb_RibbonVisible}"/>
                        </StackPanel>
                    </GroupBox>
                    <GroupBox DockPanel.Dock="Top" 
                              Header="{x:Static t:Messages.Gb_SearchBehaviour}">
                        <StackPanel>
                            <RadioButton  x:Name="cbLastName" GroupName="search" Content="{x:Static t:Messages.Rb_SearchOnLastName}"/>
                            <RadioButton x:Name="cbFirstName" GroupName="search" Content="{x:Static t:Messages.Rb_SearchOnFirstName}"/>
                            <RadioButton x:Name="cbAll" GroupName="search" Content="{x:Static t:Messages.Rb_SearchOnBotrh}"/>
                            <DockPanel>
                                <Label Content="{x:Static t:Messages.Lbl_SearchBehaviour}" VerticalAlignment="Center"/>
                                <ComboBox x:Name="searchBehaviour"
                                          Margin="5">
                                    <ComboBoxItem Content="{x:Static t:Messages.Cb_Contains}" 
                                                  Tag="true"/>
                                    <ComboBoxItem Content="{x:Static t:Messages.Cb_StartsWith}" 
                                                  Tag="false"/>
                                </ComboBox>
                            </DockPanel>
                        </StackPanel>
                    </GroupBox>
                    <Label DockPanel.Dock="Bottom"/>
                </DockPanel>
            </TabItem>
            <TabItem Header="{x:Static t:Messages.Tab_RecordEditor}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <GroupBox Header="{x:Static t:Messages.Gb_Fonts}">
                        <DockPanel>
                            <Label DockPanel.Dock="Left" 
                                   Content="Font:"
                                   VerticalAlignment="Center"/>

                            <ComboBox x:Name="cbSize" 
                                      DockPanel.Dock="Right"
                                      Margin="5"
                                      IsEditable="True"
                                      Width="50"
                                      TextBoxBase.TextChanged="cbSize_TextChanged">
                                <sys:Double>7</sys:Double>
                                <sys:Double>8</sys:Double>
                                <sys:Double>9</sys:Double>
                                <sys:Double>10</sys:Double>
                                <sys:Double>11</sys:Double>
                                <sys:Double>12</sys:Double>
                                <sys:Double>14</sys:Double>
                                <sys:Double>16</sys:Double>
                                <sys:Double>18</sys:Double>
                                <sys:Double>20</sys:Double>
                                <sys:Double>22</sys:Double>
                                <sys:Double>24</sys:Double>
                                <sys:Double>26</sys:Double>
                                <sys:Double>28</sys:Double>
                                <sys:Double>36</sys:Double>
                                <sys:Double>48</sys:Double>
                                <sys:Double>72</sys:Double>
                            </ComboBox>

                            <ComboBox DockPanel.Dock="Left"
                                      x:Name="cbFont"
                                      Margin="5"
                                      IsEditable="True" 
                                      SelectionChanged="cbFont_SelectionChanged"/>
                        </DockPanel>
                    </GroupBox>
                    <GroupBox Grid.Row="1" 
                              Header="{x:Static t:Messages.Gb_FontResult}">
                        <TextBlock x:Name="example"
                                   Text="{x:Static t:Messages.Msg_DefaultFont}"
                                   TextWrapping="Wrap" 
                                   ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                   ScrollViewer.VerticalScrollBarVisibility="Visible"/>
                    </GroupBox>
                </Grid>
            </TabItem>
        </TabControl>
    </DockPanel>
</Window>
